// import operate from '@feidao/web/atom/nodejs/db/operate';
import count from '@dfeidao/atom-nodejs/db/count';
import query from '@dfeidao/atom-nodejs/db/query';
// import sys_date from '@feidao/web/atom/nodejs/msg/sys-date'; // 获取系统时间
// import { IBaseTable } from '@dfeidao/service/interfaces';
// import { systemid } from './config';
interface Message {
	filter: {
		productid: string;
	};
	asc: string[];
	desc: string[];
	// systemid: string,
	page_size: number;
	page_no: number;
}

// 端点下拉框初始化的值
export default async function atom(msg: Message, action_id: string, session_id: string) {
	const systemid = '11';
	const { exec, prepare } = query(action_id, session_id, systemid);
	prepare('product_clent_type', ['_id', 'productid', "client_style", 'client_point_id'], { productid: msg.filter.productid, client_style: { $ne: 'desk' } }, 10, 1, [], []);
	const [data] = await exec();
	const { exec: e3, prepare: p3 } = count(action_id, session_id, systemid);
	p3('product_clent_type', { productid: msg.filter.productid, client_style: { $ne: 'desk' } });
	const [n1] = await e3();
	return { dataArray: data, count: n1 };
}
